package com.shcz.migu.observe.order_observe;


import com.shcz.migu.observe.base_observe.IObserver;

/**
 * Created by Administrator on 2015/10/13.
 */
public class OrderObserverService {
    private static OrderObserverService mService;
    private OrderObserverNode mObserverNode;

    public static OrderObserverService getInstance() {
        if (null == mService) {
            synchronized (OrderObserverService.class) {
                if (null == mService) {
                    mService = new OrderObserverService();
                }
            }
        }
        return mService;
    }

    private OrderObserverService() {
        initService();
    }

    private void initService() {
        mObserverNode = new OrderObserverNode();
    }

    public void registerObserver(IObserver observer) {
        mObserverNode.registerObserver(observer);
    }

    public void unRegisterObserver(IObserver observer) {
        mObserverNode.unRegisterObserver(observer);
    }
    public void setData(String  data){
        mObserverNode.setData(data);
    }


    public void notifyDataChanged(int requestCode) {
        mObserverNode.setRequestCode(requestCode);
        mObserverNode.notifyDataChanged();
    }
}
